<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 <title></title>
 <link rel="stylesheet" type="text/css" href="/assets/css/bootstrap.min.css">
 <link rel="stylesheet" type="text/css" href="/assets/fonts/line-icons.css">
 <link href="/assets/plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
 <link href="/assets/plugins/datatables/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
 <link href="/assets/plugins/datatables/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
 <link rel="stylesheet" type="text/css" href="/assets/css/main.css">
 <link rel="stylesheet" type="text/css" href="/assets/css/responsive.css">
</head>
<body>
<div class="card-header border-bottom">
 <h4 class="card-title">员工信息管理</h4>
 <div th:if="${msg != null}"><h4 th:text="${msg}" class="msg"></h4></div>
</div>
<div class="card-body">
 <div class="table-responsive">
  <table id="datatable" class="table table-bordered">
   <thead>
   <tr>
    <th>编号</th>
    <th>账号</th>
    <th>姓名</th>
    <th>电话</th>
    <th>身份证</th>
    <th>性别</th>
    <th>年龄</th>
    <th>职务</th>
    <th>状态</th>
    <th>操作</th>
   </tr>
   </thead>
   <tbody>
   <tr th:each="t,line : ${ paUser.items }">
    <td th:text="${ t.id }"></td>
    <td th:text="${ t.userName }"></td>
    <td th:text="${ t.realName }"></td>
    <td th:text="${ t.phone }"></td>
    <td th:text="${ t.card }"></td>
    <td th:text="${ t.gender==0 ? '女':'男' }"></td>
    <td th:text="${ t.age }"></td>
    <td th:text="${ t.role==0 ? '超级管理员':'员工' }"></td>
    <td th:text="${ t.state==0 ? '离职':'在职' }"></td>
    <td th:id="${ t.id }">
     <a href="javascript:void (0)" class="see">编辑</a>
    </td>
   </tr>
   </tbody>
  </table>
  <div id="jump">
   <a href="javascript:void (0)" class="btn btn-common">首页</a>
   <a href="javascript:void (0)" class="btn btn-common">上一页</a>
   <a href="javascript:void (0)" class="btn btn-common">下一页</a>
   <a href="javascript:void (0)" class="btn btn-common">尾页</a>
  </div>
 </div>
</div>
<script type="text/javascript" th:inline="javascript">
  $(".msg").slideUp(2000);

 var curr = [[${paUser.curr}]];
 var total = [[${paUser.total}]];
 if(curr == 1){
  $("#jump a:lt(2)").hide()
 }
 if(curr == total){
  $("#jump a:gt(1)").hide()
 }

   $("#jump a:eq(0)").bind("click",function () {
     toJump("/user/query","curr="+1)
   })
  $("#jump a:eq(1)").bind("click",function () {
     toJump("/user/query","curr="+[[${paUser.curr-1}]])
   })
  $("#jump a:eq(2)").bind("click",function () {
     toJump("/user/query","curr="+[[${paUser.curr+1}]])
   })
  $("#jump a:eq(3)").bind("click",function () {
     toJump("/user/query","curr="+[[${paUser.total}]])
   })

 $(".see").bind("click",function () {
  var id = $(this).parent().attr("id")
  toJump("/user/see","&id="+id)
 })

</script>


<script src="/assets/js/jquery-min.js"></script>
<script src="/assets/js/popper.min.js"></script>
<script src="/assets/js/bootstrap.min.js"></script>
<script src="/assets/js/jquery.app.js"></script>
<script src="/assets/js/main.js"></script>
<script src="/assets/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="/assets/plugins/datatables/dataTables.bootstrap4.min.js"></script>
<script src="/assets/plugins/datatables/dataTables.buttons.min.js"></script>
<script src="/assets/plugins/datatables/buttons.bootstrap4.min.js"></script>
<script src="/assets/plugins/datatables/jszip.min.js"></script>
<script src="/assets/plugins/datatables/pdfmake.min.js"></script>
<script src="/assets/plugins/datatables/vfs_fonts.js"></script>
<script src="/assets/plugins/datatables/buttons.html5.min.js"></script>
<script src="/assets/plugins/datatables/buttons.print.min.js"></script>
<script src="/assets/plugins/datatables/buttons.colVis.min.js"></script>
<script src="/assets/plugins/datatables/dataTables.responsive.min.js"></script>
<script src="/assets/plugins/datatables/responsive.bootstrap4.min.js"></script>
</body>
</html>